<template>
  <div>{{ gender }}</div>
  <button @click="sendMessage">给父组件发送消息</button>
</template>

<script setup>
defineProps({
  message: String,
  gender: String,
});
const emit = defineEmits(['message-sent']);
function sendMessage(){
  emit('message-sent','来自子组件的你');
}
</script>